/*
 * @Description: 1
 * @Version: 1.0
 * @Autor: haozhuang
 * @Date: 2020-04-28 14:34:17
 * @LastEditors: haozhuang
 * @LastEditTime: 2020-05-11 17:26:33
 */
import Vue from 'vue'
import Popconfirm from '@/components/Popconfirm'
Vue.component('Popconfirm', Popconfirm)

import 'normalize.css/normalize.css' // A modern alternative to CSS resets

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'

import '@/styles/index.scss' // global css

import App from './App'
import store from './store'
import router from './router'

import '@/icons' // icon
import '@/permission' // permission control

import contentmenu from 'v-contextmenu'
import 'v-contextmenu/dist/index.css'

import uploader from 'vue-simple-uploader'
console.log(uploader)
// rem h5 适配
// import 'amfe-flexible/index.js'
import './directives'

import moment from 'moment'
moment.locale('zh-cn')
Vue.prototype.$moment = moment

import getLogo from '@/plugin/getLogo'
import VueClipboard from 'vue-clipboard2'
import animated from 'animate.css'
Vue.use(animated)
Vue.use(VueClipboard)
Vue.use(getLogo)
Vue.use(contentmenu)
Vue.use(ElementUI)
Vue.use(uploader)

Vue.config.productionTip = false

const relativePath = window.location.pathname.split('/')[1]
Vue.prototype.$relativePath = relativePath === '' ? relativePath : '/' + relativePath
if (process.env.NODE_ENV === 'development') {
  Vue.prototype.ServerUrl = 'api'
} else {
  Vue.prototype.ServerUrl = ''
}
// Vue.prototype.ServerUrl = 'http://192.168.90.176:7788'

new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})
